package cn.gmcx.lazy.izze.controller;

import cn.gmcx.lazy.izze.pojo.Tap;
import cn.gmcx.lazy.izze.service.TabService;
import cn.gmcx.lazy.izze.service.impl.TabServiceImpl;
import cn.gmcx.lazy.izze.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tab")
public class TabController {

    @Autowired
    private TabService tabService;

    @GetMapping("/selectById")
    public Result selectById(@RequestParam Integer id){
        Tap tap = tabService.selectById(id);
        return Result.success(tap);
    }

    @GetMapping("/selectAll_tab")
    public Result selectAll(){
        List<Tap> tap = tabService.selectAll();
        return Result.success(tap);
    }
}
